/* ----------------------------------------------------------------------
*
* Copyright (C) 2025 XiaoFei. All rights reserved.
*
* $file:		XiaoFei_Usart1.h
* $Date:        13-January-2025
* $Revision: 	V1
* $Project: 	XiaoFei BSP Library
*
* -------------------------------------------------------------------- */

#ifndef __XiaoFei_Usart1_H
#define __XiaoFei_Usart1_H

#define Usart1_AddRx
#define Usart1_GPIO_TX			        GPIOA
#define Usart1_Pin_TX		            GPIO_Pin_9
#define Usart1_BaudRate		            9600

#ifdef Usart1_AddRx
    #define Usart1_GPIO_RX			    GPIOA
	#define Usart1_Pin_RX				GPIO_Pin_10
	#define USART1_Group				NVIC_PriorityGroup_2
	#define USART1_ITPre				1
	#define USART1_ITSub				1
#endif

/* 
* @function: 	Usart1_Init
*/
void Usart1_Init(void);

/* 
* @function: 	Usart1_SendByte
* @parameter:	[in] Byte					 The byte will be send.
*/
void Usart1_SendByte(unsigned char Byte);

/* 
* @function: 	Usart1_Printf
* @parameter:	[in] format					 The parameter will be send in Usart1_Printf.
*/
void Usart1_Printf(char *format, ...);

#ifdef Usart1_AddRx
/* 
* @function: 	USART1_IRQHandler
* @callback:	The function will be callback when the Usart1 receive the data.
*/
void USART1_IRQHandler(void);
#endif

#endif

